//设置localStorage
const set= (name, val)=> {
        localStorage.setItem(name, JSON.stringify(val))
}
//获取localStorage
const get=(name)=>{
        return JSON.parse(localStorage.getItem(name))||localStorage.getItem(name)
}
//追加localStorage
const add = (name, addVal)=> {
        let oldVal = get(name)
        let newVal = oldVal.concat(addVal)
        set(name, newVal)
}
export default {
        set,get,add
}
